package com.zbkj.dal.base.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum ShareProfitSceneEnums {

    RECRUIT("RECRUIT", "用户成为会员", "拉新"),
    PRODUCT_RECYCLE_SALE("PRODUCT_RECYCLE_SALE", "供享商品（托底模式，货权转移）", "供享"),
    PRODUCT_RECYCLE_COLLATERAL("PRODUCT_RECYCLE_COLLATERAL", "供享商品（自如模式，货权不转移）", "供享"),
    PRODUCT_LEASE_BUY("PRODUCT_LEASE_BUY", "承享商品（保价模式，货权转移）", "承享"),
    PRODUCT_LEASE("PRODUCT_LEASE", "承享商品（非保价模式，货权不转移）", "承享"),
    PRODUCT_BUY("PRODUCT_BUY", "购买商品", "买入"),
    WORLDWIDE_FIND("WORLDWIDE_FIND", "全球找货", "找货"),
    RECYCLE_CONSIGNMENT("RECYCLE_CONSIGNMENT", "回收寄卖", "回收寄卖"),
    REPAIR_UPKEEP("REPAIR_UPKEEP", "维修保养", "维修保养"),
    LUXURY_SWAP("LUXURY_SWAP", "奢品置换", "奢品置换"),
    EVALUATION_AUTHENTICATE("EVALUATION_AUTHENTICATE", "评估鉴定", "评估鉴定");

    private final String code;
    private final String item;
    private final String desc;

    public static String getDescByCode(String code) {
        if (StringUtils.isBlank(code)) {
            return null;
        }
        return Arrays.stream(ShareProfitSceneEnums.values()).filter(e -> StringUtils.equals(code, e.getCode())).map(ShareProfitSceneEnums::getDesc).findFirst().orElse(null);
    }
}
